

def quick_sort(lst):
    if len(lst) <= 1:
        return lst
    base = lst[0]
    left = [lst[i] for i in range(1,len(lst)) if lst[i] < base]
    right = [lst[i] for i in range(1,len(lst)) if lst[i] >= base]
    return quick_sort(left) + [base] + quick_sort(right)
'''
时间复杂度：平均复杂度：O(n*logN) 最坏：O(n*logN) 最坏：O(n^2)
空间复杂度：O(logN)
'''

print(quick_sort([5,4,3,2,1,6,7,8,9,10]))


